import request from '@/router/request'
const baseUrl = "/api/sys/dept"

export function getList(params) {
  return request({
    url: baseUrl + "/list",
    method: 'get',
    params
  })
}

export function getDeptTree(params) {
  return request({
    url: baseUrl + "/tree",
    method: 'get',
    params
  })
}

export function remove(id) {
  return request({
    url: baseUrl + '/' + id,
    method: 'delete',
  })
}

export function add(data) {
  return request({
    url: baseUrl + "/save",
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: baseUrl + "/update",
    method: 'put',
    data
  })
}